import common from './common'
import paths from './paths'

const statisticsReportService = {};

(function (service) {
    /**
     * 获取报表地址
     * @param {String} id
     * @returns
     */
     service.previewStatisticsReport = function (statisticsReportId) {
        return common.get(paths.statisticsReport.previewStatisticsReport, { statisticsReportId: statisticsReportId })
    }

    /**
     * 获取根目录下统计报表分组
     * @returns
     */
    service.listStatisticsReportsRootGroup = function () {
        return common.get(paths.statisticsReport.listStatisticsReportsRootGroup, null)
    }

    /**
     * 通过父id获取统计报表，包括分组下的统计报表
     * @param {String} parentId
     * @returns
     */
    service.listStatisticsReportsWithChildrenByParentId = function (parentId) {
        return common.get(paths.statisticsReport.listStatisticsReportsWithChildrenByParentId, { parentId: parentId })
    }
})(statisticsReportService)

export default statisticsReportService
